<?php

namespace app\datalog;

class AdMonitorLog extends StorageDatalogBase
{
    // 日志名称
    protected $name = 'monitor';

    // 请求日志单独存放
    protected $logPath = 'datalogs/monitor';

    protected $maxSaveDay = 30;

    protected $formatter = 'context';

    public function addLog($log, $info)
    {
        $params = $log->toArray();
        $params['push_ip'] = request()->getRealIp();
        $params['data'] = $info->data;

        $this->log($params);
    }
}
